package com.hy.webview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import com.hy.hybase.utils.HYServiceLoader
import com.hy.hywebview_export.autoservice.HYWebViewService
import com.hy.webview.databinding.ActivityMainBinding

class MainActivity : AppCompatActivity() {

    private val dkWebViewService = HYServiceLoader.load(HYWebViewService::class.java)
    private lateinit var binding: ActivityMainBinding

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        binding= ActivityMainBinding.inflate(layoutInflater)
        setContentView(binding.root)

        binding.startDemo.setOnClickListener {
            dkWebViewService?.startWebViewActivity(this, "https://www.baidu.com", "测试标题")
        }

        binding.startLocalDemo.setOnClickListener {
            dkWebViewService?.startWebViewActivity(this,"file:///android_asset/demo.html", "测试标题")
        }

    }
}